﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OleDb;
using System.Configuration;
using spbtzb;

public partial class UserControls_TongZhanDongTai : System.Web.UI.UserControl
{
    protected string flashvarsString = Common.GetflashvarsString();

    protected void Page_Load(object sender, EventArgs e)
    {
        OleDbConnection conn = new OleDbConnection(ConString.ConnString);
        conn.Open();
        rpDongTai.DataSource = AccessHelper.ExecuteDataTable(conn, CommandType.Text,
                   "SELECT TOP 8 C.ID,C.Title,C.CreateTime,CT.ContentType FROM Contents C ,ContentAndType CT ,ContentType T"+
                   " WHERE CT.TypeID=T.ID And C.ID=CT.ContentID And (T.TypeCode='TZDT' OR T.ParentType='TZDT') Order By C.CreateTime DESC,C.ID DESC");
        rpDongTai.DataBind();
        conn.Close();
    }

    protected string CutString(string inputStr, int Length)
    {
        return Common.CutString(inputStr, Length);
    }

    protected string ConvertTime(object obj)
    {
        if (obj is Nullable)
            return "";
        try
        {
            DateTime dt = DateTime.Parse(obj.ToString());
            return "(" + dt.Year.ToString() + "-" + dt.Month.ToString() + "-" + dt.Day.ToString() + ")";
        }
        catch { }
        return "";

    }
}
